package com.ziyia.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

public class BlankFragment extends Fragment {


    private View root;
    private TextView textView1;
    private Button button1;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        if (root == null) {
            root = inflater.inflate(R.layout.fragment_blank, container, false);
        }

        textView1 = root.findViewById(R.id.textView1);
        button1 = root.findViewById(R.id.button1);

        button1.setOnClickListener(e -> {
            textView1.setText("我很好，你呢？");
        });

        return root;
    }
}